package com.zhuss.core.processor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.core.information.DetailInformationVo;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.exception.DzcxException;


@Component("informationCheck")
public class InformationCheck {
	
	@Autowired
	@Qualifier("informationRead")
	private InformationRead informationRead;

	
	public boolean checkStart(Long informationId) throws DzcxException {
		DetailInformationVo information = ((DetailInformationVo) informationRead.detail(informationId));
		if (StartStopEnum.停用.sameKey(information.getStatus())) {
			return true;
		}
		return false;
	}
	
	public boolean checkStop(Long informationId) throws DzcxException {
		DetailInformationVo information = ((DetailInformationVo) informationRead.detail(informationId));
		if (StartStopEnum.启用.sameKey(information.getStatus())) {
			return true;
		}
		return false;
	}
	
}
